FB.init({
	appId : '233999643296575',
	status : true,
	cookie : true,
	xfbml : true
});

// Normally, we would wrap this in an anonymous function, but we want it to be
// available for later.
// Get the spreadsheet we need.
var energyLastThirtyDays = 'https://spreadsheets.google.com/spreadsheet/tq?key=0An9ynmXUoikYdHhxeW1xRURQZUlGd1oxVERnQktsWXc';
var refreshInterval = 0; // don't refresh this spreadsheet.

// Load the visualization API and the spreadsheet, then call displayRank.
var loader = new org.wattdepot.gdata.GDataLoader(displayRank,	energyLastThirtyDays, refreshInterval);

function displayRank(energyDataTable) {
	// The source for which we want to find the rank must be specified by
	// Makahiki.
	var source = 'Ilima-E';
	var energyRank = new org.wattdepot.gdata.makahiki.EnergyRank();

	// Get the usage for the current round and overall.

	// console.log('Overall start: 87, end: 67');
	var usage = energyRank.processDataTable(energyDataTable, 87, 67);
	var info = energyRank.calculateRankInfo(usage, source);

	// Check if this is overall information.

	energyRank.draw("overall-energy-rank", "overall-energy-value", info);

	// console.log('Round 2 start: 80, end: 74');
	var usage = energyRank.processDataTable(energyDataTable, 80, 74);
	var info = energyRank.calculateRankInfo(usage, source);

	// Check if this is overall information.

	// Check if this is info for the current round.

	// console.log('Round 1 start: 87, end: 81');
	var usage = energyRank.processDataTable(energyDataTable, 87, 81);
	var info = energyRank.calculateRankInfo(usage, source);

	// Check if this is overall information.

	// Check if this is info for the current round.

}